//
//  OldActivityHeadCell.m
//  Shengzhuli
//
//  Created by FXGuo on 2017/7/24.
//  Copyright © 2017年 kamangkeji. All rights reserved.
//

#import "OldActivityHeadCell.h"
#import <UIButton+WebCache.h>

@interface OldActivityHeadCell ()

@property (weak, nonatomic) IBOutlet UILabel *titleLab;
@property (weak, nonatomic) IBOutlet UILabel *timeLab;
@property (weak, nonatomic) IBOutlet UIButton *avatorBtn;
@property (weak, nonatomic) IBOutlet UILabel *nameLab;
@property (strong, nonatomic) IBOutlet UILabel *fromLabel;


@end

@implementation OldActivityHeadCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setModel:(OldActivityDetailModel *)model
{
    _model = model;
    if (!model) return;
    self.titleLab.text = @"";
    if (model.title) {
        self.titleLab.text = [NSString stringWithFormat:@"%@",model.title];
    }
    self.timeLab.text = @"";
    if (model.createDate) {
        self.timeLab.text = [NSString stringWithFormat:@"发布时间：%@",model.createDate];
    }
    self.nameLab.text = @"";
    if (model.clubName) {
        self.nameLab.text = model.clubName;
    }else {
        self.nameLab.text = @"玩转地球商旅学苑";
    }
    self.fromLabel.text = @"来源:";
    [self.avatorBtn sd_setImageWithURL:[NSURL URLWithString:model.clubLogo] forState:UIControlStateNormal placeholderImage:GetImage(@"person_avatar")];
}
- (IBAction)clubClick:(UIButton *)btn
{
    if (!self.model.clubName) return;
    if (self.clubInBlock) {
        self.clubInBlock(self.model);
    }
}

@end
